//
//  ViewController.m
//  FactoryDemo
//
//  Created by hs on 2017/7/13.
//  Copyright © 2017年 jiachen. All rights reserved.
//

#import "ViewController.h"
#import "PersonFactory.h"
#import "Person.h"
#import "Teacher.h"
#import "Student.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    PersonFactory *personFactory = [[PersonFactory alloc]init];
    
    for (int i=0; i<5; i++) {
        [personFactory createObject:TeacherClassName compelete:^(Person *object) {
            [object printClassName];
        }];
    }
    
    for (int i=0; i<5; i++) {
        [personFactory createObject:StudentClassName compelete:^(Person *object) {
            [object printClassName];
        }];

    }
 
    // Do any additional setup after loading the view, typically from a nib.
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
